<html>
    <head>
        <title>基本信息编辑</title>
        <link href="{$Think.const.ADMIN_CSS_URL}bootstrap.css" rel="stylesheet" />
        <link href="{$Think.const.ADMIN_CSS_URL}lz-style.css" rel="stylesheet" />
        <script src="{$Think.const.ADMIN_JS_URL}jquery.js"></script>
        <script src="{$Think.const.ADMIN_JS_URL}jquery.form.js"></script>
        <script src="{$Think.const.ADMIN_JS_URL}bootstrap.js"></script>
        <script src="{$Think.const.ADMIN_JS_URL}DatePicker/WdatePicker.js"></script>
        <script language="JavaScript">

            $(function () {
                $('#editform').ajaxForm({
                    beforeSubmit: checkForm, // pre-submit callback
                    success: complete, // post-submit callback
                    dataType: 'json'
                });
                function checkForm() {

                    if ('' == $.trim($('#VIPNo').val())) {
                        $('#success').hide();
                        $('#error').html('[{$Think.const.LB_VIPNO}]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#VIPLoginCode').val())) {
                        $('#success').hide();
                        $('#error').html('[{$Think.const.LB_VIPLOGINCODE}]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#VIPName').val())) {
                        $('#success').hide();
                        $('#error').html('[{$Think.const.LB_VIPNAME}]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#VIPNickName').val())) {
                        $('#success').hide();
                        $('#error').html('[{$Think.const.LB_VIPNICKNAME}]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#VIPPhoneNo').val())) {
                        $('#success').hide();
                        $('#error').html('[{$Think.const.LB_VIPPHONENO}]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#Sex').val())) {
                        $('#success').hide();
                        $('#error').html('[{$Think.const.LB_SEX}]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#Mail').val())) {
                        $('#success').hide();
                        $('#error').html('[{$Think.const.LB_MAIL}]不能为空').show();
                        return false;
                    }

                }
                function complete(data) {
                    if (data.status === 1) {
                        $('#error').hide();
                        $('#success').html(data.info).show();
                    } else {
                        $('#success').hide();
                        $('#error').html(data.info).show();
                    }
                }

            });

        </script>

    </head>
    <body>
        <div class="container">
            <div class="row div_head" >
                <div class=" col-xs-6 col-sm-6 text-primary">
                              {$loction}
                </div>
                <div class="col-xs-6 col-sm-3"></div>
                <div class="col-xs-6 col-sm-3">
                    <a style="text-decoration: none" href="__CONTROLLER__/lst">【返回】</a>
                </div>
            </div>

            <hr />
            <div class="row div_form" >
                <form id="editform" action="__SELF__" method="post">
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="VIPNo" class="control-label">{$Think.const.LB_VIPNO}:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="VIPNo" name="VIPNo" class="form-control" placeholder="{$Think.const.LB_VIPNO}"  value="{$post.vipno}" maxlength="42"   required />
                    </div>
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="VIPLoginCode" class="control-label">{$Think.const.LB_VIPLOGINCODE}:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="VIPLoginCode" name="VIPLoginCode" class="form-control" placeholder="{$Think.const.LB_VIPLOGINCODE}"  value="{$post.viplogincode}" maxlength="20"   required />
                    </div>
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="VIPName" class="control-label">{$Think.const.LB_VIPNAME}:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="VIPName" name="VIPName" class="form-control" placeholder="{$Think.const.LB_VIPNAME}"  value="{$post.vipname}" maxlength="42"   required />
                    </div>
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="VIPNickName" class="control-label">{$Think.const.LB_VIPNICKNAME}:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="VIPNickName" name="VIPNickName" class="form-control" placeholder="{$Think.const.LB_VIPNICKNAME}"  value="{$post.vipnickname}" maxlength="42"   required />
                    </div>
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="VIPPhoneNo" class="control-label">{$Think.const.LB_VIPPHONENO}:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="VIPPhoneNo" name="VIPPhoneNo" class="form-control" placeholder="{$Think.const.LB_VIPPHONENO}"  value="{$post.vipphoneno}" maxlength="11"   required />
                    </div>
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="Sex" class="control-label">{$Think.const.LB_SEX}:</label></div>
                    <div class="col-xs-6 col-sm-3" >
        <select id="Sex" name="Sex" class="form-control" value="{$post.sex}"   required>
            <option value="" style="display: none"></option>
            <foreach name="GV_Enum.Sex" item="row" key="k">
            <if condition="$k eq $post.sex ">
            <option value="{$k}" selected = "selected" >{$k}-{$row}</option>
            <else />
            <option value="{$k}" >{$k}-{$row}</option>
            </if>
            </foreach>
        </select>
                    </div>
<div class="text-right col-xs-6 col-sm-3 " ><label for="BirthDay" class="control-label">{$Think.const.LB_BIRTHDAY}:</label></div>
                    <div class="col-xs-6 col-sm-3" >
                        <input type="text" id="BirthDay" name="BirthDay" class="form-control Wdate" placeholder="{$Think.const.LB_BIRTHDAY}" onClick="WdatePicker({el: this, isShowClear: false, readOnly: true, skin: 'whyGreen', dateFmt: 'yyyy/MM/dd'})"  value="{$post.birthday}"  />
                    </div>
<div class="text-right col-xs-6 col-sm-3 div_required" ><label for="Mail" class="control-label">{$Think.const.LB_MAIL}:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="Mail" name="Mail" class="form-control" placeholder="{$Think.const.LB_MAIL}"  value="{$post.mail}" maxlength="50"   required />
                    </div>
<div class="text-right col-xs-6 col-sm-3 " ><label for="VIPType" class="control-label">{$Think.const.LB_VIPTYPE}:</label></div>
                    <div class="col-xs-6 col-sm-3" >
        <select id="VIPType" name="VIPType" class="form-control" value="{$post.viptype}"   >
            <option value="" style="display: none"></option>
            <foreach name="GV_Enum.VIPType" item="row" key="k">
            <if condition="$k eq $post.viptype ">
            <option value="{$k}" selected = "selected" >{$k}-{$row}</option>
            <else />
            <option value="{$k}" >{$k}-{$row}</option>
            </if>
            </foreach>
        </select>
                    </div>
<div class="text-right col-xs-6 col-sm-3 " ><label for="VIPLevel" class="control-label">{$Think.const.LB_VIPLEVEL}:</label></div>
                    <div class="col-xs-6 col-sm-3" >
        <select id="VIPLevel" name="VIPLevel" class="form-control" value="{$post.viplevel}"   >
            <option value="" style="display: none"></option>
            <foreach name="GV_Enum.VIPLevel" item="row" key="k">
            <if condition="$k eq $post.viplevel ">
            <option value="{$k}" selected = "selected" >{$k}-{$row}</option>
            <else />
            <option value="{$k}" >{$k}-{$row}</option>
            </if>
            </foreach>
        </select>
                    </div>
<div class="text-right col-xs-6 col-sm-3  " ><label for="VIPFigthValue" class="control-label">{$Think.const.LB_VIPFIGTHVALUE}:</label></div>
                    <div class="col-xs-6 col-sm-3 div_number" >
                        <input type="number" id="VIPFigthValue" name="VIPFigthValue" class="form-control" placeholder="{$Think.const.LB_VIPFIGTHVALUE}"  value="{$post.vipfigthvalue}"   />
                    </div>
<div class="text-right col-xs-6 col-sm-3 " ><label for="VIPIMG" class="control-label">{$Think.const.LB_VIPIMG}:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="VIPIMG" name="VIPIMG" class="form-control" placeholder="{$Think.const.LB_VIPIMG}"  value="{$post.vipimg}" maxlength="42"    />
                    </div>

                    <div class="col-xs-6 col-sm-3">
                        <input type="submit" id="search"  class="btn btn-default" value="提交">
                    </div>

                </form>
            </div>
            <div id="error" class="row text-danger"></div>
            <div id="success" class="row text-success"></div>

        </div>

    </body>
</html>
